package java期末练习.text49;

public class MyStringTest {
    public static void main(String[] args) {
        String str1 = "hello java";
        String str2 = "hello java";

        if (str1.equals(str2)) {
            String newStr = str1.replaceAll("\\s", "").replace("java", "word");
            System.out.println(newStr);
        } else {
            System.out.println("两个字符串不相等。");
        }
    }
}